using System;
using System.IO;
using System.Net;

namespace AnTunes
{
	public class WebTrack : Track
	{
		public WebTrack(Uri url)
		{
			Url = url;
		}
		
		public WebTrack(string url)
		{
			Url = new Uri(url);
		}
		
		public override Stream OpenStream()
		{
			WebRequest request = HttpWebRequest.Create(Url);		
			return new UnseekableStreamWrapper(request.GetResponse().GetResponseStream());
		}
				
		protected override void UpdateInfo()
		{
			info_ = new WebTrackInfo(this);
		}
				
		public Uri Url
		{
			get;
			protected set;
		}
	}}

